package com.zp.self.module.level_5_设计模式.行为型模式.Ⅵ_观察者模式.Observer;

import lombok.Data;

import java.util.Observable;

@Data
public class Thief extends Observable {
    private String name;
    public Thief(String name) {
        this.name = name;
    }
    public void steal(String object) {
        System.out.println("小偷：我偷东西了，有没有人来抓我！！！"+object);
        super.setChanged(); //changed  = true
        super.notifyObservers(object);
    }
}
